﻿﻿using System;

 namespace BaseSyntax.Event.EventWithArgs
{
	public class RunEvent:ITest
	{
		public void Test()
		{
			Connection connection = new Connection();
			
			Display display = new Display();
			
			connection.Handle += display.DisplayMsg;
			connection.Handle += display.DisplayMsg1;
			// 使用匿名方法
			connection.Handle += delegate(object sender, EventArg arg) {  };

			connection.Connect();
			Console.ReadKey();
		}
	}
}